package com.chiao.action;

import java.io.IOException;

import javax.mail.MessagingException;
import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.ClassUtils;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.chiao.core.BaseController;
import com.chiao.service.admin.LoginService;
import com.chiao.service.core.MailService;

@Controller
@RequestMapping(value="/front")
public class FrontAction extends BaseController{

	@Autowired
	MailService service;
	
	@Autowired 
	LoginService logservice;
	
	@RequestMapping
	public String main() throws MessagingException{
//		System.out.println(3/0);
		
//		Member m=new Member();
//		m.setEmail("zhangyinyou@126.com");
//		m.setName("张银友");
//		service.sendRegMsg(m);
		return "front/index";
	}
	
	@RequestMapping(value="/test")
	public String test(@RequestParam String ndame){
		return "front/loyyin";
	}
	
	@ResponseBody
	@RequestMapping(value="/test2")
	public String test2(){
		logservice.add();
		return "fdsfs";
	}
        
        @RequestMapping(value="/login")
        public String login(){
            return "front/login";
        }
	
}
